package com.dc.enums;

/**
 * @description: TODO
 * @date: 2022/11/03 15:16
 * @author: zhang
 **/
public enum DeviceAndWorkOrderType {

    /**
     * 状态对应
     */
    FAULT_TYPE(1, 0),
    ALARM_TYPE(4, 5);

    /**
     * 设备状态类型
     */
    private int devCode;

    /**
     * 工单状态类型
     */
    private int orderCode;

    DeviceAndWorkOrderType(int devCode, int orderCode) {
        this.devCode = devCode;
        this.orderCode = orderCode;
    }

    public static int getValues(int devCode) {
        for (DeviceAndWorkOrderType value : values()) {
            if (value.devCode == devCode) {
                return value.orderCode;
            }
        }
        return 0;
    }

    public int getOrderCode() {
        return orderCode;
    }

    public int getDevCode() {
        return devCode;
    }
}
